`timescale 1ns/1ps
module five_multiple_top;
	reg [7:0]A;
	wire Z;
	initial begin 
		A = 8'd0;
		# 1 A = 8'd3;
		# 1 A = 8'd10;
		# 1 A = 8'd13;
		# 1 A = 8'd14;
		# 1 A = 8'd25;
		# 1 A = 8'd34;
		# 1 A = 8'd55;
		# 1 A = 8'd56;
		# 1 A = 8'd65;
		# 1 A = 8'd76;
		# 1 A = 8'd125;
		# 1 A = 8'd126;
		# 2 $stop;
	end
	five_multiple fm(Z,A);
	initial
  	begin
    	$dumpfile("test.vcd");
    	$dumpvars(0, fm);
  	end 
endmodule

module five_multiple(Z,A);
    input [7:0]A;
    output Z;	 
    wire [4:0]temp1;
    assign temp1 = (5'd1&{5{A[0]}})+(5'd2&{5{A[1]}})+(5'd4&{5{A[2]}})+
    (5'd3&{5{A[3]}})+(5'd1&{5{A[4]}})+(5'd2&{5{A[5]}})+(5'd4&{5{A[6]}})+(5'd3&{5{A[7]}});
    assign Z = (temp1 == 5'd0 | temp1== 5'd5 | temp1 ==5'd10|temp1==5'd15|temp1==5'd20)?1:0;
endmodule
